<style type="text/css">
	.border-container::after {
		content: "Usuário";
	}
</style>
<div class="container">
	{{ Form::open(array('url' => 'user', 'class' => 'form-horizontal', 'role' => 'form')) }}
		<div class="border-container">
			@if (!$errors->isEmpty())
			<div class="alert alert-danger">
				<strong>Ocorreram os seguintes erros:</strong>
				{{ HTML::ul($errors->all()) }}
			</div>
			@endif
			
			<ul class="nav nav-tabs">
				<li class="active"><a href="#identification" data-toggle="tab">Identificação</a></li>
	            <li><a href="#privileges" data-toggle="tab">Permissões</a></li>
			</ul>
			
			<div class="tab-content">
            	<div class="tab-pane active" id="identification">
		            <div class="form-group">
						<label for="name" class="col-sm-2 control-label">Nome</label>
						<div class="col-sm-4">
		                	{{ Form::text('name', null, array('class'=>'form-control')) }}
						</div>
		            </div>
					<div class="form-group">
						<label for="surname" class="col-sm-2 control-label">Sobrenome</label>
						<div class="col-sm-4">
							{{ Form::text('surname', null, array('class'=>'form-control')) }}
						</div>
					</div>
					<div class="form-group">
						<label for="username" class="col-sm-2 control-label">Usuário</label>
						<div class="col-sm-4">
							{{ Form::text('username', null, array('class'=>'form-control')) }}
						</div>
					</div>
					<div class="form-group">
						<label for="password" class="col-sm-2 control-label">Senha</label>
						<div class="col-sm-4">
							{{ Form::password('password', array('class'=>'form-control')) }}
						</div>
					</div>
					<div class="form-group">
						<label for="password_confirmation" class="col-sm-2 control-label">Confirme a senha</label>
						<div class="col-sm-4">
							{{ Form::password('password_confirmation', array('class'=>'form-control')) }}
						</div>
					</div>
				</div>
				
				<div class="tab-pane" id="privileges">
					<ul class="list-group">
						@foreach($privileges as $item)
							<li class="list-group-item">
								<div class="checkbox">
									<label>
										{{ Form::checkbox('privileges[]', $item->id) }} {{ $item->name }}
								    </label>
								</div>
							</li>
						@endforeach
					</ul>
				</div>
			</div>
      	</div>
      
      	{{ Form::submit('Cadastrar Usuário', array('id' => 'btn-save-user', 'class'=>'btn btn-primary', 'data-loading-text' => 'Aguarde...'))}}
      	{{ HTML::link('user', 'Cancelar', array('class' => 'btn btn-default', 'style'=>'float: right')) }}
      {{ Form::close() }}
    </div>